﻿Public Class Node
    Public X As Double
    Public Y As Double
    Public Z As Double
    Public DownNode As Node
    Public Visited As Boolean
    Public TooFar As Boolean

    Public Function Slope() As Double
        If DownNode Is Nothing Then
            Return 0
        Else
            Return GetSlope(DownNode)
        End If
    End Function

    Public Function GetSlope(ByVal DownNode As Node) As Double
        Dim dx As Double
        Dim dy As Double
        Dim dist As Double
        dx = X - DownNode.X
        dy = Y - DownNode.Y
        dist = Math.Sqrt(dx * dx + dy * dy)
        Return (Z - DownNode.Z) / dist
        ' Return (Z - DownNode.Z) / Math.Sqrt(Math.Pow(X - DownNode.X, 2) + Math.Pow(Y - DownNode.Y, 2))
    End Function



End Class

Public Class Zone
    Public ID As Integer
    Public Column As Integer
    Public Row As Integer
    Public ContaintedNodes() As Integer
End Class
